package com.encryption.service.qrc.impl;

import com.encryption.service.qrc.DocEncryptHandler;
import com.encryption.service.qrc.DocOperEncrypt;
import com.encryption.util.AuthUtil;

public class DocEncryptHandlerImpl implements DocEncryptHandler {

    public boolean encrypt(String mySubjectName, String receiverSubjectNames,
                           String sourceFilePath, String targetFilePath) {
        DocOperEncrypt encHandler = DocOperEncrypt.getInstance();
        return encHandler.Encrypt(mySubjectName, receiverSubjectNames, sourceFilePath,
            targetFilePath);
        
    }
    
    public boolean isReg() {
        DocOperEncrypt encHandler = DocOperEncrypt.getInstance();
        return encHandler.isReg();
    }
    
    public boolean reg(String corpName, String code) {
        String mac = AuthUtil.getMacOnWindow();
        String corp = corpName + "*" + mac.trim();
        DocOperEncrypt encHandler = DocOperEncrypt.getInstance();
        return encHandler.reg(corp, code);
    }

}
